Repository navigation
feat(doop): purge route wiring and end-to-end tests (CHE-9646) [squash] - #170
Merged
Merged
Conversation
added 3 commits
November 27, 2026 04:55
Add POST /api/frames/:id/purge (REST only, body {deletedAt}) and
server/framePurge.ts, the only caller of purgeTrashedFrame and
resolvePurgeOutcome. Every refusal and timeout leaves all rows; an outcome
the database has not confirmed keeps the lease until the probe answers.
tests/framePurge.test.ts covers T1-T9, T11, T12, T14 (PG-only lock
orderings run when DOOP_TEST_PG_URL is set). TECHSTACK soft-delete bullet
names the route, its guards and the comment refusal (CHE-9450).
…ct reboot tests (CHE-9646)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stage 3 of CHE-9399 ("delete forever"), issue CHE-9646.
POST /api/frames/:id/purge, body{deletedAt:number}, REST only (server/index.ts).server/framePurge.ts: settles the frame's writers, runspurgeTrashedFrame, and ends the lease on a known outcome only. It is the only server file that namespurgeTrashedFrameandresolvePurgeOutcome.tests/framePurge.test.ts: T1–T9, T11, T12 (a, b, d, e), T14 (a–f)..context/TECHSTACK.md: soft-delete bullet names the purge route, its guards and the comment refusal (pointer to CHE-9450).No migration, no schema change, no release, no C00 deploy. The
persist.tsdelete count stays 3 andframeTrashPersistALLOWED already listsserver/db/purge.ts.Reply map
{ok:true}not_in_trashdeletedAtmissing / not a numberdeletedAtdiffers from Trashstale_confirmation+ currentdeletedAthas_comments(memory and database)purge_in_progresscomponent_mainpurge_timeoutpurge_not_appliedpurge_outcome_unknown; lease kept, probe finishes itEvery refusal and timeout leaves all rows.
Proof
Test-first: the test file was written before the route.
Red (route absent),
npx vitest run tests/framePurge.test.ts:Green on the committed head
35dbdd76, same command (PGlite):Green on real PostgreSQL (
postgres:16-alpine,DOOP_TEST_PG_URLset; the 4 skipped are the lock-ordering tests e2, e3, e4, e2r that need it):Related suites on PostgreSQL (
framePurgePg,framePurgeLease,framePurgeFence,frameTrashPersist,frameTrash):bun run typecheck,bun run lint,bun run build: pass (gstack-checks run).Not run, and deviations
bun run testdid not finish in my 580 s limit locally. CI is the full-suite proof.bun test, which has novi.hoisted; it fails on every vitest file (91 of 168). Runner mismatch, not this change.beforeSettlehook stands in for the held write (T4, T5, T11). T11's held Trash-marker write is approximated the same way.purgeTrashedFrameandresolvePurgeOutcome; the transaction really commits, or never runs.tests/framePurgeReboot.test.ts.DOOP_TEST_PG_URL; they skip without it.Review gate
Draft. Needs a cross-lab PASS on the exact head, green required checks, and a non-author merge.